import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'file_picker_platform_interface.dart';

/// An implementation of [FilePickerPlatform] that uses method channels.
class MethodChannelFilePicker extends FilePickerPlatform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel = const MethodChannel('file_picker');

  @override
  Future<Map?> getFile() async {
    final file = await methodChannel.invokeMethod<Map?>('getFile');
    return file;
  }

  @override
  Future<String?> getCacheDir() async {
    final dir = await methodChannel.invokeMethod<String?>('getCacheDir');
    return dir;
  }
}
